<template>
  <div class="menu-manage-page">
    <!-- 顶部操作栏 -->
    <div class="top-bar">
      <el-button type="primary">新增</el-button>
      <el-button>编辑</el-button>
      <el-button>删除</el-button>
      <el-button>刷新</el-button>
    </div>

    <!-- 左右分栏 -->
    <div class="content-wrapper">
      <!-- 左侧菜单树 -->
      <div class="menu-tree">
        <el-tree
          :data="treeData"
          :props="treeProps"
          @node-click="handleNodeClick"
          default-expand-all
          node-key="id"
        />
      </div>

      <!-- 右侧表单编辑区 -->
      <div class="form-panel">
        <h3 class="panel-title">菜单编辑</h3>
        <el-form :model="form" label-width="80px">
          <el-form-item label="菜单名称">
            <el-select v-model="form.menuName" placeholder="请选择">
              <el-option label="图标入选择" value="iconSelect" />
              <!-- 更多选项... -->
            </el-select>
          </el-form-item>
          <el-form-item label="选择">
            <el-input v-model="form.choice" placeholder="没选择" />
          </el-form-item>
          <el-form-item label="路径">
            <el-select v-model="form.path" placeholder="请输入">
              <!-- 下拉选项... -->
            </el-select>
          </el-form-item>
          <el-form-item label="排序号">
            <el-input-number v-model="form.sort" :min="1" />
          </el-form-item>
          <!-- 更多表单项... -->
          <el-form-item>
            <el-button type="primary">简洁</el-button>
            <el-button>明确</el-button>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script setup>
import { treeData, treeProps, form, handleNodeClick } from '../index';
</script>
<style scoped lang="scss">
.menu-manage-page {
  padding: 20px;
  background-color: #fff;

  .top-bar {
    margin-bottom: 20px;
    button {
      margin-right: 10px;
    }
  }

  .content-wrapper {
    display: flex;
    gap: 20px;

    .menu-tree {
      width: 300px;
      border: 1px solid #eee;
      padding: 10px;
      border-radius: 4px;
    }

    .form-panel {
      flex: 1;
      border: 1px solid #eee;
      padding: 20px;
      border-radius: 4px;

      .panel-title {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 16px;
      }
    }
  }
}
</style>
